import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App'

import Index from './components/Index'
import Order from './components/Order'
import Product from './components/Product'
import Category from './components/Category'
import Content from './components/Content'
import IptvFlavors from './components/IptvFlavors'
import IptvFlavorApps from './components/IptvFlavorApps'
import IptvFlavorAppCategories from './components/IptvFlavorAppCategories'

Vue.config.debug = true

Vue.use(VueRouter)
var router = new VueRouter({
  linkActiveClass: 'w-link'
})

router.map({
  '/product': {
    name: 'index',
    component: Index
  },
  '/product/:productId': {
    name: 'product',
    component: Product
  },
  '/product/:productId/category/:categoryId': {
    name: 'category',
    component: Category
  },
  '/product/:productId/category/:categoryId/content/:contentId': {
    name: 'content',
    component: Content
  },
  '/order': {
    name: 'order',
    component: Order
  },
  '/iptv/index': {
    name: 'iptvindex',
    component: IptvFlavors
  },
  '/iptv/flavor/:flavor': {
    name: 'iptvflavor',
    component: IptvFlavorApps
  },
  '/iptv/flavor/:flavor/app/:app': {
    name: 'iptvapp',
    component: IptvFlavorAppCategories
  }
})

router.redirect({
  '/': '/product',
  '/index': '/product'
})

router.start(App, '#app')
